<template>
<div class="fix-page">
        <div id="login" class="place">
        <headerNav :isShowBack="true" title="登录"></headerNav>
        <div class="a"><a href=""></a></div>
        <div class="title">
            <h2>手机动态密码登录</h2>
            <p class="p1">未注册的手机号验证后将自动创建账号</p >
        </div>
        <div class="phone-num">
            <p class="phone">手机号码</p><br>
            <input type="text" name="" value="+86" class="text1" readonly="true">&nbsp;&nbsp;
            <input class="num" type="text" v-model="phone" maxlength="11"  name="pwd"  ><br><br>
            <input @click="sendCode()" class="yzm" type="button" value="发送验证码" ><br><br>
            <a class="left" @click="$router.push('/phone_login')">使用账号密码登录</a>
            <div class="text2">
            <p>使用其他方式登录</p>
            <img src="../../assets/img/login_img/ddd.png">
            </div>
        </div>
        <div class="foot">
            <a>注册/登录即代表您年满18岁，已认真阅读并同意接受Rook《服务条款》、《隐私政策》，并同意订阅Rook特惠信息和政策更新，您可在设置中随时退订。</a>
        </div>
    </div>
</div>
</template>

<script>
    import {getSmsCode} from 'network/index'
    import headerNav from 'components/HeaderNav/headerNav'
    export default {
        name: "security_code",
        components:{
            headerNav
        },
        data(){
          return{
              phone:""
          }
        },
        methods:{
            sendCode(){
                const phoneReg = /^1[3456789]\d{9}$/;
                if(!phoneReg.test(this.phone)){
                    this.$toast({
                        message: '请输入正确的手机信息',
                        type:"fail"
                    });
                    return
                }
                getSmsCode({
                    phone: this.phone
                }).then(res=>{
                    console.log(res);
                }).catch(err=>{

                })
                this.$router.push('/input_scode')
            }
        }
    }
</script>

<style scoped>
    .fix-page{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 888;
    background-color: #fff;
    }
    .place{
    width: 100%;
    overflow: auto;
    }
    .text2{
      text-align: center;
      margin-top: 100px;

    }
   #login{
       padding: 0 20px 80px;
   }
  .num{
      background:transparent;
      border:none;
      border-bottom: 1px solid #ccc;
      height: 40px;
      width: 200px;
  }
  .yzm{
      height: 50px;
      width: 100%;
      text-align: center;
      background-color: rgb(33, 90, 146);
      border-radius:8px;
      border: none;
      margin-top: 10px;
      color:rgb(255, 255, 255);
  }
  .foot{
      font-size: 13px;
      margin-right: 20px;
      text-align: center;
      margin-top: 30px;
      line-height: 1.4;
      bottom: 55px;
  }
  .phone{
      margin-top: 80px;
  }
  .left{
      margin-top: 16px;
      color: rgb(0, 138, 133);
  }
  .p1{
      margin-top: 10px;
  }
  .text1{
      height:40px;
      width:50px;
      text-align: center;
  }
  .title{
      padding-top:10px;
  }
</style>